package com.lovo.middleman.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lovo.middleman.bean.SellBean;
import com.lovo.middleman.service.ISellService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sell")
public class SellController {

    @Autowired
    ISellService iSellService;

    @RequestMapping("/getSellPage")
    public Page<SellBean> getSellPage(int curPage,
                                      int pageSize,
                                      String customerName,
                                      String startTime,
                                      String endTime){
      return   iSellService.queryPageByItem(curPage,pageSize,customerName,startTime,endTime);
    }

    @RequestMapping("/sellBean")
    public void addSellBean(SellBean sellBean){
        iSellService.addSell(sellBean);
    }

    @RequestMapping("/getSellBeanById")
    public void getSellBeanById(int sellId){
        iSellService.querySellBeanById(sellId);
    }
}
